home *** CD-ROM | disk | FTP | other *** search
/ The Net Power 1997 July / NETDisc0797.iso / mac / MSIE / Microsoft Internet Apps BETA / Personal Web Server / Personal Web Site Files 1.0a / default.asp next >
Text File  |  1997-03-21  |  12KB  |  426 lines

  1. <% ' This is the default home page for your personal Web site. It combines HTML with
  2.      Active Server Pages (ASP) server-side scripting to describe a dynamic home page
  3.      that displays the information you enter in the Microsoft Personal Web Server
  4.      control panel. It also shows or hides links and other information based on the 
  5.      files that are present in your Web site folder. 
  6.      
  7.      All ASP tags are handled by PWS, before sending the document to a browser.
  8.      When viewing this page, a browser will receive standard HTML. ASP is a powerful
  9.      tool for creating dynamic Web sites. To learn more about how ASP works in
  10.      Microsoft Personal Web Server for Macintosh, open the Microsoft Personal Web Server 
  11.      control panel and choose Personal Web Server Help from the Help menu 
  12.      
  13.      If you want to create your own Web site content, you can add new files to the 
  14.      My Personal Web Site folder, or replace these default files completely. ' %>
  15.  
  16. <% ' ASP variable assignments ' %>
  17.  
  18.     <% if MyInfo.pageType = "1" then %> <% PageType = "Company" %> <% end if %>
  19.     <% if MyInfo.pageType = "2" then %> <% PageType = "Home" %> <% end if %>
  20.     <% if MyInfo.pageType = "3" then %> <% PageType = "School" %> <% end if %>
  21.     <% if MyInfo.pageType = "4" then %> <% PageType = "Organization" %> <% end if %>
  22.     <% if MyInfo.pageType = "5" then %> <% PageType = "Community" %> <% end if %>
  23.     
  24.     <% cells = 0 %>
  25.     
  26.     <% if myInfo.personalName <> "" or myInfo.personalAddress <> "" or myInfo.personalPhone <> "" 
  27.         or MyInfo.personalMail <> "" or MyInfo.personalWords <> "" then %>
  28.         <% PersonalContent = true %><% cells = cells + 1 %>
  29.     <% else %>
  30.         <% PersonalContent = false %>
  31.     <% end if %>
  32.  
  33.     <% if tools.FileExists("mypicture.jpg") or tools.FileExists("mypicture.gif") then %>
  34.         <% PersonalPicture = true %><% cells = cells + 1 %>
  35.     <% else %>
  36.         <% PersonalPicture = false %>
  37.     <% end if %>
  38.  
  39.     <% if myInfo(PageType + "Name") <> "" or myInfo(PageType + "Address") <> "" or 
  40.         myInfo(PageType + "Phone") <> "" or myInfo(PageType + "Department") <> "" or 
  41.         myInfo(PageType + "Words") <> "" or (PageType = "Home" and (myInfo.homeOccupation <> "" or 
  42.         myInfo.homePeople <> "") ) or (PageType = "Community" and (myInfo.communityLocation <> "" or 
  43.         myInfo.communityPopulation <> "")) then %>
  44.         <% PageContent = true %><% cells = cells + 1 %>
  45.     <% else %>
  46.         <% PageContent = false %>
  47.     <% end if %>
  48.  
  49.     <% if tools.FileExists(pageType & "Picture.jpg") or tools.FileExists(pageType & "Picture.gif") then %>
  50.         <% PagePicture = true %><% cells = cells + 1 %>
  51.     <% else %>
  52.         <% PagePicture = false %>
  53.     <% end if %>
  54.  
  55.     <% if MyInfo.url1 <> "" or MyInfo.url2 <> "" or MyInfo.url3 <> "" or MyInfo.url4 <> "" or 
  56.         MyInfo.url5 <> "" or MyInfo.url6 <> "" or MyInfo.url7 <> "" or MyInfo.url1Words <> "" or 
  57.         MyInfo.url2Words <> "" or MyInfo.url3Words <> "" or MyInfo.url4Words <> "" or 
  58.         MyInfo.url5Words <> "" or MyInfo.url6Words <> "" or MyInfo.url7Words <> "" then %>
  59.         <% hasLinks = true %>
  60.     <% else %>
  61.         <% hasLinks = false %>
  62.     <% end if %>
  63.  
  64. <% ' end of variable assignments ' %>
  65.  
  66. <html>
  67. <head>
  68.  
  69. <% if not tools.owner and request.querystring("signin") = "true" then %>
  70.     <% response.status = "401 Unauthorized" %>
  71. <% end if %>
  72.  
  73. <% if MyInfo.personalName <> "" then %>
  74.     <title><% =MyInfo.personalName %>'<% if right(myInfo.personalName, 1) <> "s" then %>s<% end if %> Home Page</title>
  75. <% else %>
  76.     <% if MyInfo(PageType + "Name") <> "" then %>
  77.         <title><% = MyInfo(PageType + "Name") %></title>
  78.     <% else %>
  79.         <title>My Home Page</title>
  80.     <% end if %>
  81. <% end if %>
  82. <%if tools.FileExists("/style.css") then %>
  83.     <LINK REL=STYLESHEET TYPE="text/css" HREF="/style.css">
  84. <% end if %>
  85. </head>
  86.  
  87. <BODY BGCOLOR="#FFFFFF">
  88.  
  89. <% if cells > 0 then %> <% 'hides table if no user data ' %>
  90.  
  91.     <TABLE border=0 cellpadding=8>
  92.  
  93.     <tr>
  94.  
  95.     <td valign=top <% if cells > 1 then %> rowspan=2 <% end if %> bgcolor="#CCCCCC" nowrap >
  96.     
  97. <% else %> <% 'if no user data, centers text instead' %>
  98.  
  99.     <center>
  100.  
  101. <% end if %>
  102.  
  103. <%' begin sidebar ' %>
  104.  
  105.     <h2>Welcome!</h2>
  106.     You are visitor number <% counter.increment( "home" ) %><% = counter.get( "home" ) %>.<p>
  107.     Today is <% = monthname( month( now ) ) %> <% = day( now ) %>, <% = year( now ) %>.<p>
  108.     The local time is <% = time %>.<br>
  109.     <p>
  110.  
  111.     <% if tools.FileExists( "Message%20Scripts/LeaveMessage.asp" ) or tools.FileExists( "Guestbook/Guestbook.asp" ) 
  112.         or tools.FileExists("My%20Shared%20Documents/") then %>
  113.             <h4>While you are here...</h4>
  114.         <% if tools.FileExists( "Guestbook/Guestbook.asp" ) then %>
  115.             <a href="Guestbook/Guestbook.asp">Read my guestbook</a><br>
  116.         <% end if %>
  117.         
  118.         <% if tools.FileExists( "Message%20Scripts/LeaveMessage.asp" ) then %>
  119.             <a href="Message%20Scripts/LeaveMessage.asp">Leave me a private message</a><br>
  120.         <% end if %>
  121.         
  122.         <% if MyInfo.personalMail <> "" then %>
  123.             <a href="mailto:<% =MyInfo.personalMail %>">Send me e-mail</a><br>
  124.         <% end if %>
  125.  
  126.         <% if tools.FileExists("My%20Shared%20Documents/") then %>
  127.             <a href="My%20Shared%20Documents/">Access shared documents</a><br>
  128.         <% end if %>
  129.         
  130.     <% end if %>
  131.  
  132.     <% if hasLinks then %>
  133.         
  134.         <h4>My favorite Web sites...</h4>
  135.  
  136.         <% if MyInfo.url1 <> "" then %>    
  137.             <a href="<% =server.urlEncode(MyInfo.url1) %>">
  138.                 <%if MyInfo.url1Words <> "" then %>
  139.                     <% =MyInfo.url1Words %>
  140.                 <% else %>
  141.                     <% =MyInfo.url1 %>
  142.                 <% end if %>
  143.             </a><br>
  144.         <% end if %>
  145.         
  146.         <% if MyInfo.url1 = "" and MyInfo.url1Words <> "" then %>
  147.             <% =MyInfo.url1Words %><br>
  148.         <% end if %>
  149.  
  150.         <% if MyInfo.url2 <> "" then %>
  151.             <a href="<% =server.urlEncode(MyInfo.url2) %>">
  152.                 <%if MyInfo.url2Words <> "" then %>
  153.                     <% =MyInfo.url2Words %>
  154.                 <% else %>
  155.                     <% =MyInfo.url2 %>
  156.                 <% end if %>
  157.             </a><br>
  158.         <% end if %>
  159.         
  160.         <% if MyInfo.url2 = "" and MyInfo.url2Words <> "" then %>
  161.             <% =MyInfo.url2Words %><br>
  162.         <% end if %>
  163.  
  164.         <% if MyInfo.url3 <> "" then %>
  165.             <a href="<% =server.urlEncode(MyInfo.url3) %>">
  166.                 <%if MyInfo.url3Words <> "" then %>
  167.                     <% =MyInfo.url3Words %>
  168.                 <% else %>
  169.                     <% =MyInfo.url3 %>
  170.                 <% end if %>
  171.             </a><br>
  172.         <% end if %>
  173.         
  174.         <% if MyInfo.url3 = "" and MyInfo.url3Words <> "" then %>
  175.             <% =MyInfo.url3Words %><br>
  176.         <% end if %>
  177.  
  178.         <% if MyInfo.url4 <> "" then %>
  179.             <a href="<% =server.urlEncode(MyInfo.url4) %>">
  180.                 <%if MyInfo.url4Words <> "" then %>
  181.                     <% =MyInfo.url4Words %>
  182.                 <% else %>
  183.                     <% =MyInfo.url4 %>
  184.                 <% end if %>
  185.             </a><br>
  186.         <% end if %>
  187.         
  188.         <% if MyInfo.url4 = "" and MyInfo.url4Words <> "" then %>
  189.             <% =MyInfo.url4Words %><br>
  190.         <% end if %>
  191.  
  192.         <% if MyInfo.url5 <> "" then %>
  193.             <a href="<% =server.urlEncode(MyInfo.url5) %>">
  194.                 <%if MyInfo.url5Words <> "" then %>
  195.                     <% =MyInfo.url5Words %>
  196.                 <% else %>
  197.                     <% =MyInfo.url5 %>
  198.                 <% end if %>
  199.             </a><br>
  200.         <% end if %>
  201.         
  202.         <% if MyInfo.url5 = "" and MyInfo.url5Words <> "" then %>
  203.             <% =MyInfo.url5Words %><br>
  204.         <% end if %>
  205.  
  206.         <% if MyInfo.url6 <> "" then %>
  207.             <a href="<% =server.urlEncode(MyInfo.url6) %>">
  208.                 <%if MyInfo.url6Words <> "" then %>
  209.                     <% =MyInfo.url6Words %>
  210.                 <% else %>
  211.                     <% =MyInfo.url6 %>
  212.                 <% end if %>
  213.             </a><br>
  214.         <% end if %>
  215.         
  216.         <% if MyInfo.url6 = "" and MyInfo.url6Words <> "" then %>
  217.             <% =MyInfo.url6Words %><br>
  218.         <% end if %>
  219.  
  220.         <% if MyInfo.url7 <> "" then %>
  221.             <a href="<% =server.urlEncode(MyInfo.url7) %>">
  222.                 <%if MyInfo.url7Words <> "" then %>
  223.                     <% =MyInfo.url7Words %>
  224.                 <% else %>
  225.                     <% =MyInfo.url7 %>
  226.                 <% end if %>
  227.             </a><br>
  228.         <% end if %>
  229.         
  230.         <% if MyInfo.url7 = "" and MyInfo.url7Words <> "" then %>
  231.             <% =MyInfo.url7Words %><br>
  232.         <% end if %>
  233.  
  234.     <% end if %> <% 'ends if haslink' %>
  235.         
  236.     <% if tools.owner then %>
  237.  
  238.         <h4>Site Administration</h4>
  239.                     
  240.             <% if tools.FileExists( "/$Received%20Messages/" ) then %>
  241.                 <a href="/$Received%20Messages/">Read private messages</a><br>
  242.             <% end if %>
  243.             
  244.             <a href="/$status/">Check server status</a><br>
  245.         
  246.             <% if myInfo.Log_Activity = "Yes" then %>
  247.                 <a href="/$status/?viewlog">View web site activity log</a><br>
  248.             <% end if %>
  249.  
  250.             <% if tools.PluginExists( "ftp plug-in" ) then %>
  251.                 <a href="/admin.ftp">Configure FTP server</a><br>
  252.             <% end if %>
  253.             
  254.             <a href="http:/$status/?shutdown">Stop server</a><br>
  255.             
  256.             <% if myInfo.Allow_Directory_Listings = "Yes" then %>
  257.                 <p>
  258.                 <h4>Remote Disk Access</h4>
  259.                 <a href="/$diskbrowse/">Browse disks (standard)</a><br>
  260.                 <a href="/$disk/">Download Mac files (use binhex)</a><br>
  261.             <% end if %>
  262.             
  263.     <% else %>
  264.     
  265.         <h4><a href="/?signin=true">Owner Sign-in</a></h4>
  266.         
  267.     <% end if %> <% 'ends if tools.owner' %>
  268.  
  269.     <%if tools.fileExists("ie_animated.gif") then %>
  270.         <center>
  271.             <% if not tools.owner then %>
  272.                    <p>   <p>
  273.              <% end if %>
  274.             <p>    <a href="http://www.microsoft.com/ie/"><img src="ie_animated.gif" border=0 hight=31 width=88></a>
  275.         </center>
  276.     <% end if %>
  277.     
  278. <%' end of sidebar ' %>
  279.         
  280. <% if cells > 0 then %> <% 'checks for user content' %>
  281.     
  282.     <TD width=<% if cells < 3 then %>60<% else %>18<% end if %>>
  283.     <TD align=center valign=middle <% if cells = 3 and PageContent and PagePicture then %> colspan=2 <% end if %>>
  284.     
  285.     <% if PersonalPicture then %>
  286.     
  287.         <% if tools.FileExists("mypicture.jpg") then %>
  288.             <img src="mypicture.jpg">
  289.         <% else %>
  290.             <% if tools.FileExists("mypicture.gif") then %>
  291.                 <img src="mypicture.gif">
  292.             <% end if %>
  293.         <% end if %>
  294.     
  295.         <% if cells = 2 and PersonalContent then %>
  296.             </tr>
  297.             <TR><TD>
  298.         <% end if %>
  299.         
  300.         <% if (cells > 1 and PersonalContent) then %>
  301.             <TD valign=middle align=center>
  302.         <% end if %>
  303.                 
  304.     <% end if %>
  305.     
  306.     <% if PersonalContent then %>
  307.     
  308.         <% if myInfo.personalName <> "" then %>
  309.             <h1><% =MyInfo.personalName %></h1>
  310.         <% end if %>
  311.  
  312.         <% if myInfo.personalAddress <> "" then %>
  313.             <% =MyInfo.personalAddress %><br>
  314.         <% end if %>
  315.  
  316.         <% if myInfo.personalPhone <> "" then %>
  317.             <% =MyInfo.personalPhone %><br>
  318.         <% end if %>
  319.  
  320.         <% if MyInfo.personalMail <> "" %>
  321.             <a href="mailto:<% =MyInfo.personalMail %>"><% =MyInfo.personalMail %></a>
  322.         <% end if %>
  323.  
  324.         <% if MyInfo.personalWords <> "" then %>
  325.             <h3><% = MyInfo.personalWords %></h3>
  326.         <% end if %>
  327.     
  328.     <% end if %>
  329.     
  330.     <% if (cells = 2 and ((PersonalPicture or PersonalContent) and (PagePicture or PageContent)) ) or cells > 2 then %>
  331.  
  332.         </tr>
  333.         <TR><TD>
  334.             
  335.             <TD align=center valign=middle <% if cells = 3 and PersonalContent and PersonalPicture then %> colspan=2 <% end if %> >
  336.  
  337.     <% end if %>
  338.         
  339.         <% if PageContent then %>
  340.  
  341.             <% if MyInfo(PageType + "Name") <> "" then %>
  342.                 <h1><% = MyInfo(PageType + "Name") %></h1>
  343.             <% else %>
  344.                     <% if PageType <> "Home" then %><h1>About My <% = PageType %></h1><% end if %>
  345.             <% end if %>
  346.  
  347.             <% if MyInfo(PageType + "Department") <> "" then %>
  348.                 <p><% = MyInfo(PageType + "Department") %><p>
  349.             <% end if %>
  350.  
  351.             <% if MyInfo(PageType + "Address") <> "" then %>
  352.                 <% = MyInfo(PageType + "Address") %><br>
  353.             <% end if %>
  354.  
  355.             <% if MyInfo(PageType + "Phone") <> "" then %>
  356.                 <% = MyInfo(PageType + "Phone") %><br>
  357.             <% end if %>
  358.  
  359.             <% if PageType = "Home" then %>
  360.                 
  361.                 <% if MyInfo.homeOccupation <> "" then %>
  362.                     <h3>My occupation...<br><% = MyInfo.homeOccupation %></h3>
  363.                 <% end if %>
  364.  
  365.                 <% if MyInfo.homePeople <> "" then %>
  366.                     <h3>I live with...<br><% = MyInfo.homePeople %></h3>
  367.                 <% end if %>
  368.             
  369.             <% end if %>
  370.  
  371.             <% if PageType = "Community" then %>
  372.             
  373.                 <% if MyInfo.communityLocation <> "" then %>
  374.                     Location: <% = MyInfo.communityLocation %><br>
  375.                 <% end if %>
  376.  
  377.                 <% if MyInfo.communityPopulation <> "" then %>
  378.                     Population: <% = MyInfo.communityPopulation %>
  379.                 <% end if %>
  380.  
  381.             <% end if %>
  382.  
  383.             <% if MyInfo(PageType + "Words") <> "" then %>
  384.                 <h3><% if PageType = "Home" then %>I spend my time...<br><% end if %><% = MyInfo(PageType + "Words") %></h3>
  385.             <% end if %>
  386.                         
  387.         <% end if %> <% ' end if pageContent ' %>
  388.  
  389.     <% if cells = 2 and PageContent and PagePicture then %>
  390.     
  391.         </tr>
  392.         <TR><TD>
  393.     
  394.     <% end if %>
  395.     
  396.     <% if cells > 1 and PagePicture and PageContent then %>
  397.  
  398.         <TD valign=middle align=center>
  399.  
  400.     <% end if %>
  401.  
  402.         <% if PagePicture then %>
  403.  
  404.                 <% if tools.FileExists( PageType + "Picture.jpg") then %>
  405.                     <img src= "<% = PageType + "Picture.jpg" %>">
  406.                 <% else %>
  407.                     <% if tools.FileExists( PageType + "Picture.gif") then %>
  408.                         <img src= "<% = PageType + "Picture.gif" %>">
  409.                     <% end if %>
  410.                 <% end if %>
  411.                 
  412.         <% end if %>
  413.         </tr>
  414.                 
  415.     </table>
  416.  
  417.     
  418. <% else %> <% ' if no user content, the text is centered' %>
  419.  
  420.     </center>
  421.     
  422. <% end if %> <% 'ends if cells > 0' %>
  423.  
  424. </body>
  425.  
  426. </html>